//
//  CatalogDBService.h
//  readNovels
//
//  Created by wulanzhou on 2017/2/28.
//  Copyright © 2017年 wulanzhou. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "Catalog.h"
#import "TFHppleElement.h"

//目录操作
@interface CatalogDBService : NSObject

/// 下载目录
/// @param urlStr                      下载地址
/// @param xpath                         查询路径
/// @param coding                       编码
/// @param enumerateBlock     遍历
/// @param finished                   完成回调
- (void)downloadCatalogWithUrl:(NSString *)urlStr
                         xpath:(NSString *)xpath
                      encoding:(NSString *)coding
                          loop:(void(^)(Catalog *catalog,TFHppleElement  *element))enumerateBlock
                     completed:(void(^)(NSArray <Catalog *> *catalogs,NSError *error))finished;

//新增目录
- (BOOL)addCatalogs:(NSArray <Catalog *> *)catalogs bookId:(NSInteger)bId;

//获取未下载完成的目录
- (NSArray <Catalog *> *)getUnFinishedCatalogsWithBookId:(NSInteger)bId;


@end
